{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "# 读取文件方便\n",
    "# 封装了Matplotlib、Numpy的画图和计算\n",
    "\n",
    "# 独特的数据结构\n",
    "# series,DataFrame,MultiIndex(老版本叫做Panel)\n",
    "# Series是一维数据结构,DataFrame是二维数据结构,MultiIndex是三维数据结构,\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "0    0\n1    1\n2    2\n3    3\n4    4\n5    5\n6    6\n7    7\n8    8\n9    9\ndtype: int32"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 2
    }
   ],
   "source": [
    "# 类似于一维数组的数据结构,Series是索引和数据组成\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "series=pd.Series(np.arange(10))\n",
    "series"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "data": {
      "text/plain": "array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 3
    }
   ],
   "source": [
    "# 创造等差数列\n",
    "np.arange(10)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "data": {
      "text/plain": "1     6.7\n2     5.6\n3     3.0\n4    10.0\n5     2.0\ndtype: float64"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 4
    }
   ],
   "source": [
    "series=pd.Series([6.7,5.6,3,10,2], index=[1,2,3,4,5])\n",
    "series"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "data": {
      "text/plain": "Int64Index([1, 2, 3, 4, 5], dtype='int64')"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 5
    }
   ],
   "source": [
    "# Series的索引和数据\n",
    "series.index\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "data": {
      "text/plain": "array([ 6.7,  5.6,  3. , 10. ,  2. ])"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 6
    }
   ],
   "source": [
    "series.values"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "numpy.ndarray"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 7
    }
   ],
   "source": [
    "type(series.values)\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "data": {
      "text/plain": "pandas.core.indexes.numeric.Int64Index"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 8
    }
   ],
   "source": [
    "type(series.index)\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [
    {
     "data": {
      "text/plain": "5.6"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 9
    }
   ],
   "source": [
    "\n",
    "series[2]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "data": {
      "text/plain": "          0         1         2\n0  0.890243 -0.658516  0.615006\n1  2.456301 -0.727209 -0.471160",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n      <th>1</th>\n      <th>2</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>0.890243</td>\n      <td>-0.658516</td>\n      <td>0.615006</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2.456301</td>\n      <td>-0.727209</td>\n      <td>-0.471160</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 10
    }
   ],
   "source": [
    "# DataFrame 行索引,axis=0,叫index,不同行,\n",
    "# 列索引,纵向索引,axis=1,叫做columns\n",
    "data_frame=pd.DataFrame(np.random.randn(2,3))\n",
    "data_frame"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "outputs": [
    {
     "data": {
      "text/plain": "array([[-0.47209261,  1.67499191,  0.27732662],\n       [ 1.10842665, -0.60364295,  0.53196009]])"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 11
    }
   ],
   "source": [
    "data=np.random.randn(2,3)\n",
    "data"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [
    {
     "data": {
      "text/plain": "numpy.ndarray"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 12
    }
   ],
   "source": [
    "type(data)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [
    {
     "data": {
      "text/plain": "array([[20, 16, 94, 47, 97],\n       [16, 75, 95, 52, 50],\n       [10, 81,  6, 16, 79],\n       [66,  3,  8, 19, 96],\n       [97, 18, 64, 40, 22],\n       [34, 74, 23,  0, 68],\n       [67, 23, 21, 64, 70],\n       [23, 97, 92, 14, 38],\n       [77, 96, 56, 11, 29],\n       [66, 60,  7, 91, 17]], dtype=int64)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 13
    }
   ],
   "source": [
    "# 生成10名同学，5门功课的数据\n",
    "score=np.random.randint(low=0,high=100,size=(10,5),dtype=np.int64)\n",
    "score\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [],
   "source": [
    "# 构造行索引序列\n",
    "subjects= [\"语文\", \"数学\", \"英语\", \"政治\", \"体育\"]\n",
    "\n",
    "# 构造列索引序列\n",
    "stu = ['同学' + str(i) for i in range(score.shape[0])]\n",
    "\n",
    "score_data=pd.DataFrame(score,columns=subjects,index=stu)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [
    {
     "data": {
      "text/plain": "     语文  数学  英语  政治  体育\n同学0  20  16  94  47  97\n同学1  16  75  95  52  50\n同学2  10  81   6  16  79\n同学3  66   3   8  19  96\n同学4  97  18  64  40  22\n同学5  34  74  23   0  68\n同学6  67  23  21  64  70\n同学7  23  97  92  14  38\n同学8  77  96  56  11  29\n同学9  66  60   7  91  17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>语文</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>同学0</th>\n      <td>20</td>\n      <td>16</td>\n      <td>94</td>\n      <td>47</td>\n      <td>97</td>\n    </tr>\n    <tr>\n      <th>同学1</th>\n      <td>16</td>\n      <td>75</td>\n      <td>95</td>\n      <td>52</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>同学2</th>\n      <td>10</td>\n      <td>81</td>\n      <td>6</td>\n      <td>16</td>\n      <td>79</td>\n    </tr>\n    <tr>\n      <th>同学3</th>\n      <td>66</td>\n      <td>3</td>\n      <td>8</td>\n      <td>19</td>\n      <td>96</td>\n    </tr>\n    <tr>\n      <th>同学4</th>\n      <td>97</td>\n      <td>18</td>\n      <td>64</td>\n      <td>40</td>\n      <td>22</td>\n    </tr>\n    <tr>\n      <th>同学5</th>\n      <td>34</td>\n      <td>74</td>\n      <td>23</td>\n      <td>0</td>\n      <td>68</td>\n    </tr>\n    <tr>\n      <th>同学6</th>\n      <td>67</td>\n      <td>23</td>\n      <td>21</td>\n      <td>64</td>\n      <td>70</td>\n    </tr>\n    <tr>\n      <th>同学7</th>\n      <td>23</td>\n      <td>97</td>\n      <td>92</td>\n      <td>14</td>\n      <td>38</td>\n    </tr>\n    <tr>\n      <th>同学8</th>\n      <td>77</td>\n      <td>96</td>\n      <td>56</td>\n      <td>11</td>\n      <td>29</td>\n    </tr>\n    <tr>\n      <th>同学9</th>\n      <td>66</td>\n      <td>60</td>\n      <td>7</td>\n      <td>91</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 15
    }
   ],
   "source": [
    "score_data"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "outputs": [
    {
     "data": {
      "text/plain": "(10, 5)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 16
    }
   ],
   "source": [
    "score_data.shape\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [
    {
     "data": {
      "text/plain": "Index(['同学0', '同学1', '同学2', '同学3', '同学4', '同学5', '同学6', '同学7', '同学8', '同学9'], dtype='object')"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 20
    }
   ],
   "source": [
    "\n",
    "score_data.index"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "outputs": [
    {
     "data": {
      "text/plain": "array([[20, 16, 94, 47, 97],\n       [16, 75, 95, 52, 50],\n       [10, 81,  6, 16, 79],\n       [66,  3,  8, 19, 96],\n       [97, 18, 64, 40, 22],\n       [34, 74, 23,  0, 68],\n       [67, 23, 21, 64, 70],\n       [23, 97, 92, 14, 38],\n       [77, 96, 56, 11, 29],\n       [66, 60,  7, 91, 17]], dtype=int64)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 21
    }
   ],
   "source": [
    "score_data.values"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "outputs": [
    {
     "data": {
      "text/plain": "Index(['语文', '数学', '英语', '政治', '体育'], dtype='object')"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 22
    }
   ],
   "source": [
    "score_data.columns"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "outputs": [
    {
     "data": {
      "text/plain": "    同学0  同学1  同学2  同学3  同学4  同学5  同学6  同学7  同学8  同学9\n语文   20   16   10   66   97   34   67   23   77   66\n数学   16   75   81    3   18   74   23   97   96   60\n英语   94   95    6    8   64   23   21   92   56    7\n政治   47   52   16   19   40    0   64   14   11   91\n体育   97   50   79   96   22   68   70   38   29   17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>同学0</th>\n      <th>同学1</th>\n      <th>同学2</th>\n      <th>同学3</th>\n      <th>同学4</th>\n      <th>同学5</th>\n      <th>同学6</th>\n      <th>同学7</th>\n      <th>同学8</th>\n      <th>同学9</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>语文</th>\n      <td>20</td>\n      <td>16</td>\n      <td>10</td>\n      <td>66</td>\n      <td>97</td>\n      <td>34</td>\n      <td>67</td>\n      <td>23</td>\n      <td>77</td>\n      <td>66</td>\n    </tr>\n    <tr>\n      <th>数学</th>\n      <td>16</td>\n      <td>75</td>\n      <td>81</td>\n      <td>3</td>\n      <td>18</td>\n      <td>74</td>\n      <td>23</td>\n      <td>97</td>\n      <td>96</td>\n      <td>60</td>\n    </tr>\n    <tr>\n      <th>英语</th>\n      <td>94</td>\n      <td>95</td>\n      <td>6</td>\n      <td>8</td>\n      <td>64</td>\n      <td>23</td>\n      <td>21</td>\n      <td>92</td>\n      <td>56</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>政治</th>\n      <td>47</td>\n      <td>52</td>\n      <td>16</td>\n      <td>19</td>\n      <td>40</td>\n      <td>0</td>\n      <td>64</td>\n      <td>14</td>\n      <td>11</td>\n      <td>91</td>\n    </tr>\n    <tr>\n      <th>体育</th>\n      <td>97</td>\n      <td>50</td>\n      <td>79</td>\n      <td>96</td>\n      <td>22</td>\n      <td>68</td>\n      <td>70</td>\n      <td>38</td>\n      <td>29</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 23
    }
   ],
   "source": [
    "score_data.T"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "outputs": [
    {
     "data": {
      "text/plain": "     语文  数学  英语  政治  体育\n同学0  20  16  94  47  97\n同学1  16  75  95  52  50\n同学2  10  81   6  16  79\n同学3  66   3   8  19  96\n同学4  97  18  64  40  22",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>语文</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>同学0</th>\n      <td>20</td>\n      <td>16</td>\n      <td>94</td>\n      <td>47</td>\n      <td>97</td>\n    </tr>\n    <tr>\n      <th>同学1</th>\n      <td>16</td>\n      <td>75</td>\n      <td>95</td>\n      <td>52</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>同学2</th>\n      <td>10</td>\n      <td>81</td>\n      <td>6</td>\n      <td>16</td>\n      <td>79</td>\n    </tr>\n    <tr>\n      <th>同学3</th>\n      <td>66</td>\n      <td>3</td>\n      <td>8</td>\n      <td>19</td>\n      <td>96</td>\n    </tr>\n    <tr>\n      <th>同学4</th>\n      <td>97</td>\n      <td>18</td>\n      <td>64</td>\n      <td>40</td>\n      <td>22</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 24
    }
   ],
   "source": [
    "score_data.head()\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "outputs": [
    {
     "data": {
      "text/plain": "     语文  数学  英语  政治  体育\n同学5  34  74  23   0  68\n同学6  67  23  21  64  70\n同学7  23  97  92  14  38\n同学8  77  96  56  11  29\n同学9  66  60   7  91  17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>语文</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>同学5</th>\n      <td>34</td>\n      <td>74</td>\n      <td>23</td>\n      <td>0</td>\n      <td>68</td>\n    </tr>\n    <tr>\n      <th>同学6</th>\n      <td>67</td>\n      <td>23</td>\n      <td>21</td>\n      <td>64</td>\n      <td>70</td>\n    </tr>\n    <tr>\n      <th>同学7</th>\n      <td>23</td>\n      <td>97</td>\n      <td>92</td>\n      <td>14</td>\n      <td>38</td>\n    </tr>\n    <tr>\n      <th>同学8</th>\n      <td>77</td>\n      <td>96</td>\n      <td>56</td>\n      <td>11</td>\n      <td>29</td>\n    </tr>\n    <tr>\n      <th>同学9</th>\n      <td>66</td>\n      <td>60</td>\n      <td>7</td>\n      <td>91</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 25
    }
   ],
   "source": [
    "score_data.tail()\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "outputs": [],
   "source": [
    "# DataFrame 索引的设置\n",
    "# 修改索引都是统一修改的\n",
    "score_data.columns=[\"语文1\", \"数学\", \"英语\", \"政治\", \"体育\"]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "outputs": [
    {
     "data": {
      "text/plain": "     语文1  数学  英语  政治  体育\n同学0   20  16  94  47  97\n同学1   16  75  95  52  50\n同学2   10  81   6  16  79\n同学3   66   3   8  19  96\n同学4   97  18  64  40  22\n同学5   34  74  23   0  68\n同学6   67  23  21  64  70\n同学7   23  97  92  14  38\n同学8   77  96  56  11  29\n同学9   66  60   7  91  17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>语文1</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>同学0</th>\n      <td>20</td>\n      <td>16</td>\n      <td>94</td>\n      <td>47</td>\n      <td>97</td>\n    </tr>\n    <tr>\n      <th>同学1</th>\n      <td>16</td>\n      <td>75</td>\n      <td>95</td>\n      <td>52</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>同学2</th>\n      <td>10</td>\n      <td>81</td>\n      <td>6</td>\n      <td>16</td>\n      <td>79</td>\n    </tr>\n    <tr>\n      <th>同学3</th>\n      <td>66</td>\n      <td>3</td>\n      <td>8</td>\n      <td>19</td>\n      <td>96</td>\n    </tr>\n    <tr>\n      <th>同学4</th>\n      <td>97</td>\n      <td>18</td>\n      <td>64</td>\n      <td>40</td>\n      <td>22</td>\n    </tr>\n    <tr>\n      <th>同学5</th>\n      <td>34</td>\n      <td>74</td>\n      <td>23</td>\n      <td>0</td>\n      <td>68</td>\n    </tr>\n    <tr>\n      <th>同学6</th>\n      <td>67</td>\n      <td>23</td>\n      <td>21</td>\n      <td>64</td>\n      <td>70</td>\n    </tr>\n    <tr>\n      <th>同学7</th>\n      <td>23</td>\n      <td>97</td>\n      <td>92</td>\n      <td>14</td>\n      <td>38</td>\n    </tr>\n    <tr>\n      <th>同学8</th>\n      <td>77</td>\n      <td>96</td>\n      <td>56</td>\n      <td>11</td>\n      <td>29</td>\n    </tr>\n    <tr>\n      <th>同学9</th>\n      <td>66</td>\n      <td>60</td>\n      <td>7</td>\n      <td>91</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 29
    }
   ],
   "source": [
    "score_data.reset_index\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "outputs": [],
   "source": [
    "# 修改索引都是统一修改的\n",
    "score_data.index=['--'+ str(i)  for i in range(score.shape[0])]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "outputs": [
    {
     "data": {
      "text/plain": "     语文1  数学  英语  政治  体育\n--0   20  16  94  47  97\n--1   16  75  95  52  50\n--2   10  81   6  16  79\n--3   66   3   8  19  96\n--4   97  18  64  40  22\n--5   34  74  23   0  68\n--6   67  23  21  64  70\n--7   23  97  92  14  38\n--8   77  96  56  11  29\n--9   66  60   7  91  17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>语文1</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>--0</th>\n      <td>20</td>\n      <td>16</td>\n      <td>94</td>\n      <td>47</td>\n      <td>97</td>\n    </tr>\n    <tr>\n      <th>--1</th>\n      <td>16</td>\n      <td>75</td>\n      <td>95</td>\n      <td>52</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>--2</th>\n      <td>10</td>\n      <td>81</td>\n      <td>6</td>\n      <td>16</td>\n      <td>79</td>\n    </tr>\n    <tr>\n      <th>--3</th>\n      <td>66</td>\n      <td>3</td>\n      <td>8</td>\n      <td>19</td>\n      <td>96</td>\n    </tr>\n    <tr>\n      <th>--4</th>\n      <td>97</td>\n      <td>18</td>\n      <td>64</td>\n      <td>40</td>\n      <td>22</td>\n    </tr>\n    <tr>\n      <th>--5</th>\n      <td>34</td>\n      <td>74</td>\n      <td>23</td>\n      <td>0</td>\n      <td>68</td>\n    </tr>\n    <tr>\n      <th>--6</th>\n      <td>67</td>\n      <td>23</td>\n      <td>21</td>\n      <td>64</td>\n      <td>70</td>\n    </tr>\n    <tr>\n      <th>--7</th>\n      <td>23</td>\n      <td>97</td>\n      <td>92</td>\n      <td>14</td>\n      <td>38</td>\n    </tr>\n    <tr>\n      <th>--8</th>\n      <td>77</td>\n      <td>96</td>\n      <td>56</td>\n      <td>11</td>\n      <td>29</td>\n    </tr>\n    <tr>\n      <th>--9</th>\n      <td>66</td>\n      <td>60</td>\n      <td>7</td>\n      <td>91</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 33
    }
   ],
   "source": [
    "score_data"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "outputs": [
    {
     "data": {
      "text/plain": "  index  语文1  数学  英语  政治  体育\n0   --0   20  16  94  47  97\n1   --1   16  75  95  52  50\n2   --2   10  81   6  16  79\n3   --3   66   3   8  19  96\n4   --4   97  18  64  40  22\n5   --5   34  74  23   0  68\n6   --6   67  23  21  64  70\n7   --7   23  97  92  14  38\n8   --8   77  96  56  11  29\n9   --9   66  60   7  91  17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>index</th>\n      <th>语文1</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>--0</td>\n      <td>20</td>\n      <td>16</td>\n      <td>94</td>\n      <td>47</td>\n      <td>97</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>--1</td>\n      <td>16</td>\n      <td>75</td>\n      <td>95</td>\n      <td>52</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>--2</td>\n      <td>10</td>\n      <td>81</td>\n      <td>6</td>\n      <td>16</td>\n      <td>79</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>--3</td>\n      <td>66</td>\n      <td>3</td>\n      <td>8</td>\n      <td>19</td>\n      <td>96</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>--4</td>\n      <td>97</td>\n      <td>18</td>\n      <td>64</td>\n      <td>40</td>\n      <td>22</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>--5</td>\n      <td>34</td>\n      <td>74</td>\n      <td>23</td>\n      <td>0</td>\n      <td>68</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>--6</td>\n      <td>67</td>\n      <td>23</td>\n      <td>21</td>\n      <td>64</td>\n      <td>70</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>--7</td>\n      <td>23</td>\n      <td>97</td>\n      <td>92</td>\n      <td>14</td>\n      <td>38</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>--8</td>\n      <td>77</td>\n      <td>96</td>\n      <td>56</td>\n      <td>11</td>\n      <td>29</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>--9</td>\n      <td>66</td>\n      <td>60</td>\n      <td>7</td>\n      <td>91</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 34
    }
   ],
   "source": [
    "# 重置索引\n",
    "score_data.reset_index()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "outputs": [
    {
     "data": {
      "text/plain": "   语文1  数学  英语  政治  体育\n0   20  16  94  47  97\n1   16  75  95  52  50\n2   10  81   6  16  79\n3   66   3   8  19  96\n4   97  18  64  40  22\n5   34  74  23   0  68\n6   67  23  21  64  70\n7   23  97  92  14  38\n8   77  96  56  11  29\n9   66  60   7  91  17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>语文1</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>20</td>\n      <td>16</td>\n      <td>94</td>\n      <td>47</td>\n      <td>97</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>16</td>\n      <td>75</td>\n      <td>95</td>\n      <td>52</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>10</td>\n      <td>81</td>\n      <td>6</td>\n      <td>16</td>\n      <td>79</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>66</td>\n      <td>3</td>\n      <td>8</td>\n      <td>19</td>\n      <td>96</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>97</td>\n      <td>18</td>\n      <td>64</td>\n      <td>40</td>\n      <td>22</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>34</td>\n      <td>74</td>\n      <td>23</td>\n      <td>0</td>\n      <td>68</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>67</td>\n      <td>23</td>\n      <td>21</td>\n      <td>64</td>\n      <td>70</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>23</td>\n      <td>97</td>\n      <td>92</td>\n      <td>14</td>\n      <td>38</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>77</td>\n      <td>96</td>\n      <td>56</td>\n      <td>11</td>\n      <td>29</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>66</td>\n      <td>60</td>\n      <td>7</td>\n      <td>91</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 35
    }
   ],
   "source": [
    "# 如果drop=True,说明这个索引需要删除老索引\n",
    "score_data.reset_index(drop=True)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "outputs": [
    {
     "data": {
      "text/plain": "     语文1  数学  英语  政治  体育\n--0   20  16  94  47  97\n--1   16  75  95  52  50\n--2   10  81   6  16  79\n--3   66   3   8  19  96\n--4   97  18  64  40  22\n--5   34  74  23   0  68\n--6   67  23  21  64  70\n--7   23  97  92  14  38\n--8   77  96  56  11  29\n--9   66  60   7  91  17",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>语文1</th>\n      <th>数学</th>\n      <th>英语</th>\n      <th>政治</th>\n      <th>体育</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>--0</th>\n      <td>20</td>\n      <td>16</td>\n      <td>94</td>\n      <td>47</td>\n      <td>97</td>\n    </tr>\n    <tr>\n      <th>--1</th>\n      <td>16</td>\n      <td>75</td>\n      <td>95</td>\n      <td>52</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>--2</th>\n      <td>10</td>\n      <td>81</td>\n      <td>6</td>\n      <td>16</td>\n      <td>79</td>\n    </tr>\n    <tr>\n      <th>--3</th>\n      <td>66</td>\n      <td>3</td>\n      <td>8</td>\n      <td>19</td>\n      <td>96</td>\n    </tr>\n    <tr>\n      <th>--4</th>\n      <td>97</td>\n      <td>18</td>\n      <td>64</td>\n      <td>40</td>\n      <td>22</td>\n    </tr>\n    <tr>\n      <th>--5</th>\n      <td>34</td>\n      <td>74</td>\n      <td>23</td>\n      <td>0</td>\n      <td>68</td>\n    </tr>\n    <tr>\n      <th>--6</th>\n      <td>67</td>\n      <td>23</td>\n      <td>21</td>\n      <td>64</td>\n      <td>70</td>\n    </tr>\n    <tr>\n      <th>--7</th>\n      <td>23</td>\n      <td>97</td>\n      <td>92</td>\n      <td>14</td>\n      <td>38</td>\n    </tr>\n    <tr>\n      <th>--8</th>\n      <td>77</td>\n      <td>96</td>\n      <td>56</td>\n      <td>11</td>\n      <td>29</td>\n    </tr>\n    <tr>\n      <th>--9</th>\n      <td>66</td>\n      <td>60</td>\n      <td>7</td>\n      <td>91</td>\n      <td>17</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 36
    }
   ],
   "source": [
    "# 以某列值设置为新的索引\n",
    "score_data\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "outputs": [
    {
     "data": {
      "text/plain": "             open  close\n2018-02-27  23.53  24.16\n2018-02-26  22.80  23.53\n2018-02-23  22.88  22.82\n2018-02-22  22.25  22.28\n2018-02-14  21.49  21.92",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>open</th>\n      <th>close</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2018-02-27</th>\n      <td>23.53</td>\n      <td>24.16</td>\n    </tr>\n    <tr>\n      <th>2018-02-26</th>\n      <td>22.80</td>\n      <td>23.53</td>\n    </tr>\n    <tr>\n      <th>2018-02-23</th>\n      <td>22.88</td>\n      <td>22.82</td>\n    </tr>\n    <tr>\n      <th>2018-02-22</th>\n      <td>22.25</td>\n      <td>22.28</td>\n    </tr>\n    <tr>\n      <th>2018-02-14</th>\n      <td>21.49</td>\n      <td>21.92</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 40
    }
   ],
   "source": [
    "data=pd.read_csv(filepath_or_buffer='.\\stock_day.csv'\n",
    "            ,sep=',',usecols=['open','close'] )\n",
    "data.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "outputs": [],
   "source": [
    "data[:10].to_csv(path_or_buf='.\\\\test.csv',index=True,   columns=['open','close'], )\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "outputs": [
    {
     "data": {
      "text/plain": "          date   low  total_turnover  close  num_trades  limit_up  limit_down  \\\n0   2021-03-10  4.08    2.546598e+07   4.09      2908.0      4.54        3.72   \n1   2021-03-11  4.03    3.035027e+07   4.21      3579.0      4.50        3.68   \n2   2021-03-12  4.16    5.731667e+07   4.42     10361.0      4.63        3.79   \n3   2021-03-15  4.39    1.105771e+08   4.86      8739.0      4.86        3.98   \n4   2021-03-16  5.35    6.590195e+07   5.35      2665.0      5.35        4.37   \n5   2021-03-17  5.89    2.779356e+07   5.89      1360.0      5.89        4.82   \n6   2021-03-18  6.02    6.896758e+08   6.48     35915.0      6.48        5.30   \n7   2021-03-19  6.14    9.281842e+08   6.87     83411.0      7.13        5.83   \n8   2021-03-22  6.54    7.070684e+08   7.56     57080.0      7.56        6.18   \n9   2021-03-23  7.18    1.009227e+09   8.32     74794.0      8.32        6.80   \n10  2021-03-24  8.75    4.638337e+08   9.15     29936.0      9.15        7.49   \n11  2021-03-25  8.24    1.406457e+09   8.78    122203.0     10.07        8.24   \n12  2021-03-26  7.90    1.084878e+09   8.20     97696.0      9.66        7.90   \n13  2021-03-29  7.71    1.073137e+09   8.25     96314.0      9.02        7.38   \n14  2021-03-30  7.43    8.168007e+08   7.51     73385.0      9.08        7.43   \n15  2021-03-31  7.15    7.424906e+08   7.40     66253.0      8.26        6.76   \n16  2021-04-01  7.01    5.871877e+08   7.30     50391.0      8.14        6.66   \n17  2021-04-02  6.97    5.391238e+08   6.98     45938.0      8.03        6.57   \n18  2021-04-06  6.90    4.933757e+08   7.11     38072.0      7.68        6.28   \n19  2021-04-07  7.00    8.267101e+08   7.56     70670.0      7.82        6.40   \n\n         volume   high  open  \n0     6129016.0   4.26  4.20  \n1     7253204.0   4.30  4.06  \n2    13122895.0   4.49  4.18  \n3    23415491.0   4.86  4.41  \n4    12318121.0   5.35  5.35  \n5     4718770.0   5.89  5.89  \n6   108723518.0   6.48  6.30  \n7   139087883.0   7.12  6.14  \n8   100705316.0   7.56  6.76  \n9   127027051.0   8.32  7.86  \n10   51111322.0   9.15  9.15  \n11  159859689.0  10.00  9.70  \n12  132371665.0   8.64  8.30  \n13  131232671.0   8.49  8.10  \n14  108642707.0   7.96  7.79  \n15   99402765.0   7.84  7.27  \n16   81607548.0   7.45  7.21  \n17   74883092.0   7.52  7.30  \n18   69771188.0   7.23  6.95  \n19  111218570.0   7.78  7.00  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>date</th>\n      <th>low</th>\n      <th>total_turnover</th>\n      <th>close</th>\n      <th>num_trades</th>\n      <th>limit_up</th>\n      <th>limit_down</th>\n      <th>volume</th>\n      <th>high</th>\n      <th>open</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>2021-03-10</td>\n      <td>4.08</td>\n      <td>2.546598e+07</td>\n      <td>4.09</td>\n      <td>2908.0</td>\n      <td>4.54</td>\n      <td>3.72</td>\n      <td>6129016.0</td>\n      <td>4.26</td>\n      <td>4.20</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2021-03-11</td>\n      <td>4.03</td>\n      <td>3.035027e+07</td>\n      <td>4.21</td>\n      <td>3579.0</td>\n      <td>4.50</td>\n      <td>3.68</td>\n      <td>7253204.0</td>\n      <td>4.30</td>\n      <td>4.06</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>2021-03-12</td>\n      <td>4.16</td>\n      <td>5.731667e+07</td>\n      <td>4.42</td>\n      <td>10361.0</td>\n      <td>4.63</td>\n      <td>3.79</td>\n      <td>13122895.0</td>\n      <td>4.49</td>\n      <td>4.18</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>2021-03-15</td>\n      <td>4.39</td>\n      <td>1.105771e+08</td>\n      <td>4.86</td>\n      <td>8739.0</td>\n      <td>4.86</td>\n      <td>3.98</td>\n      <td>23415491.0</td>\n      <td>4.86</td>\n      <td>4.41</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>2021-03-16</td>\n      <td>5.35</td>\n      <td>6.590195e+07</td>\n      <td>5.35</td>\n      <td>2665.0</td>\n      <td>5.35</td>\n      <td>4.37</td>\n      <td>12318121.0</td>\n      <td>5.35</td>\n      <td>5.35</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>2021-03-17</td>\n      <td>5.89</td>\n      <td>2.779356e+07</td>\n      <td>5.89</td>\n      <td>1360.0</td>\n      <td>5.89</td>\n      <td>4.82</td>\n      <td>4718770.0</td>\n      <td>5.89</td>\n      <td>5.89</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>2021-03-18</td>\n      <td>6.02</td>\n      <td>6.896758e+08</td>\n      <td>6.48</td>\n      <td>35915.0</td>\n      <td>6.48</td>\n      <td>5.30</td>\n      <td>108723518.0</td>\n      <td>6.48</td>\n      <td>6.30</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>2021-03-19</td>\n      <td>6.14</td>\n      <td>9.281842e+08</td>\n      <td>6.87</td>\n      <td>83411.0</td>\n      <td>7.13</td>\n      <td>5.83</td>\n      <td>139087883.0</td>\n      <td>7.12</td>\n      <td>6.14</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>2021-03-22</td>\n      <td>6.54</td>\n      <td>7.070684e+08</td>\n      <td>7.56</td>\n      <td>57080.0</td>\n      <td>7.56</td>\n      <td>6.18</td>\n      <td>100705316.0</td>\n      <td>7.56</td>\n      <td>6.76</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>2021-03-23</td>\n      <td>7.18</td>\n      <td>1.009227e+09</td>\n      <td>8.32</td>\n      <td>74794.0</td>\n      <td>8.32</td>\n      <td>6.80</td>\n      <td>127027051.0</td>\n      <td>8.32</td>\n      <td>7.86</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>2021-03-24</td>\n      <td>8.75</td>\n      <td>4.638337e+08</td>\n      <td>9.15</td>\n      <td>29936.0</td>\n      <td>9.15</td>\n      <td>7.49</td>\n      <td>51111322.0</td>\n      <td>9.15</td>\n      <td>9.15</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>2021-03-25</td>\n      <td>8.24</td>\n      <td>1.406457e+09</td>\n      <td>8.78</td>\n      <td>122203.0</td>\n      <td>10.07</td>\n      <td>8.24</td>\n      <td>159859689.0</td>\n      <td>10.00</td>\n      <td>9.70</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>2021-03-26</td>\n      <td>7.90</td>\n      <td>1.084878e+09</td>\n      <td>8.20</td>\n      <td>97696.0</td>\n      <td>9.66</td>\n      <td>7.90</td>\n      <td>132371665.0</td>\n      <td>8.64</td>\n      <td>8.30</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>2021-03-29</td>\n      <td>7.71</td>\n      <td>1.073137e+09</td>\n      <td>8.25</td>\n      <td>96314.0</td>\n      <td>9.02</td>\n      <td>7.38</td>\n      <td>131232671.0</td>\n      <td>8.49</td>\n      <td>8.10</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>2021-03-30</td>\n      <td>7.43</td>\n      <td>8.168007e+08</td>\n      <td>7.51</td>\n      <td>73385.0</td>\n      <td>9.08</td>\n      <td>7.43</td>\n      <td>108642707.0</td>\n      <td>7.96</td>\n      <td>7.79</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>2021-03-31</td>\n      <td>7.15</td>\n      <td>7.424906e+08</td>\n      <td>7.40</td>\n      <td>66253.0</td>\n      <td>8.26</td>\n      <td>6.76</td>\n      <td>99402765.0</td>\n      <td>7.84</td>\n      <td>7.27</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>2021-04-01</td>\n      <td>7.01</td>\n      <td>5.871877e+08</td>\n      <td>7.30</td>\n      <td>50391.0</td>\n      <td>8.14</td>\n      <td>6.66</td>\n      <td>81607548.0</td>\n      <td>7.45</td>\n      <td>7.21</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>2021-04-02</td>\n      <td>6.97</td>\n      <td>5.391238e+08</td>\n      <td>6.98</td>\n      <td>45938.0</td>\n      <td>8.03</td>\n      <td>6.57</td>\n      <td>74883092.0</td>\n      <td>7.52</td>\n      <td>7.30</td>\n    </tr>\n    <tr>\n      <th>18</th>\n      <td>2021-04-06</td>\n      <td>6.90</td>\n      <td>4.933757e+08</td>\n      <td>7.11</td>\n      <td>38072.0</td>\n      <td>7.68</td>\n      <td>6.28</td>\n      <td>69771188.0</td>\n      <td>7.23</td>\n      <td>6.95</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>2021-04-07</td>\n      <td>7.00</td>\n      <td>8.267101e+08</td>\n      <td>7.56</td>\n      <td>70670.0</td>\n      <td>7.82</td>\n      <td>6.40</td>\n      <td>111218570.0</td>\n      <td>7.78</td>\n      <td>7.00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 57
    }
   ],
   "source": [
    "# ,index_col=0 将第一列作为索引,没有的话,自动建立索引\n",
    "data1=pd.read_csv(filepath_or_buffer='.\\\\test1.csv',sep=',')\n",
    "data1"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "outputs": [
    {
     "data": {
      "text/plain": "   000001.SZ  000002.SZ  000004.SZ  000005.SZ  000006.SZ  000007.SZ  \\\n0      16.30      17.71       4.58       2.88      14.60       2.62   \n1      17.02      19.20       4.65       3.02      15.97       2.65   \n2      17.02      17.28       4.56       3.06      14.37       2.63   \n3      16.18      16.97       4.49       2.95      13.10       2.73   \n4      16.95      17.19       4.55       2.99      13.18       2.77   \n\n   000008.SZ  000009.SZ  000010.SZ  000011.SZ    ...      001965.SZ  \\\n0       4.96       4.66       5.37       6.02    ...            NaN   \n1       4.95       4.70       5.37       6.27    ...            NaN   \n2       4.82       4.47       5.37       5.96    ...            NaN   \n3       4.89       4.33       5.37       5.77    ...            NaN   \n4       4.97       4.42       5.37       5.92    ...            NaN   \n\n   603283.SH  002920.SZ  002921.SZ  300684.SZ  002922.SZ  300735.SZ  \\\n0        NaN        NaN        NaN        NaN        NaN        NaN   \n1        NaN        NaN        NaN        NaN        NaN        NaN   \n2        NaN        NaN        NaN        NaN        NaN        NaN   \n3        NaN        NaN        NaN        NaN        NaN        NaN   \n4        NaN        NaN        NaN        NaN        NaN        NaN   \n\n   603329.SH  603655.SH  603080.SH  \n0        NaN        NaN        NaN  \n1        NaN        NaN        NaN  \n2        NaN        NaN        NaN  \n3        NaN        NaN        NaN  \n4        NaN        NaN        NaN  \n\n[5 rows x 3562 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>000001.SZ</th>\n      <th>000002.SZ</th>\n      <th>000004.SZ</th>\n      <th>000005.SZ</th>\n      <th>000006.SZ</th>\n      <th>000007.SZ</th>\n      <th>000008.SZ</th>\n      <th>000009.SZ</th>\n      <th>000010.SZ</th>\n      <th>000011.SZ</th>\n      <th>...</th>\n      <th>001965.SZ</th>\n      <th>603283.SH</th>\n      <th>002920.SZ</th>\n      <th>002921.SZ</th>\n      <th>300684.SZ</th>\n      <th>002922.SZ</th>\n      <th>300735.SZ</th>\n      <th>603329.SH</th>\n      <th>603655.SH</th>\n      <th>603080.SH</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>16.30</td>\n      <td>17.71</td>\n      <td>4.58</td>\n      <td>2.88</td>\n      <td>14.60</td>\n      <td>2.62</td>\n      <td>4.96</td>\n      <td>4.66</td>\n      <td>5.37</td>\n      <td>6.02</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>17.02</td>\n      <td>19.20</td>\n      <td>4.65</td>\n      <td>3.02</td>\n      <td>15.97</td>\n      <td>2.65</td>\n      <td>4.95</td>\n      <td>4.70</td>\n      <td>5.37</td>\n      <td>6.27</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>17.02</td>\n      <td>17.28</td>\n      <td>4.56</td>\n      <td>3.06</td>\n      <td>14.37</td>\n      <td>2.63</td>\n      <td>4.82</td>\n      <td>4.47</td>\n      <td>5.37</td>\n      <td>5.96</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>16.18</td>\n      <td>16.97</td>\n      <td>4.49</td>\n      <td>2.95</td>\n      <td>13.10</td>\n      <td>2.73</td>\n      <td>4.89</td>\n      <td>4.33</td>\n      <td>5.37</td>\n      <td>5.77</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>16.95</td>\n      <td>17.19</td>\n      <td>4.55</td>\n      <td>2.99</td>\n      <td>13.18</td>\n      <td>2.77</td>\n      <td>4.97</td>\n      <td>4.42</td>\n      <td>5.37</td>\n      <td>5.92</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n  </tbody>\n</table>\n<p>5 rows × 3562 columns</p>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 59
    }
   ],
   "source": [
    "# 读取HDF5的文件\n",
    "data=pd.read_hdf(path_or_buf='day_close.h5')\n",
    "data.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "outputs": [],
   "source": [
    "data[:5].to_hdf('day_close_test.h5',key='day_close')"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "outputs": [
    {
     "data": {
      "text/plain": "   000001.SZ  000002.SZ  000004.SZ  000005.SZ  000006.SZ  000007.SZ  \\\n0      16.30      17.71       4.58       2.88      14.60       2.62   \n1      17.02      19.20       4.65       3.02      15.97       2.65   \n2      17.02      17.28       4.56       3.06      14.37       2.63   \n3      16.18      16.97       4.49       2.95      13.10       2.73   \n4      16.95      17.19       4.55       2.99      13.18       2.77   \n\n   000008.SZ  000009.SZ  000010.SZ  000011.SZ    ...      001965.SZ  \\\n0       4.96       4.66       5.37       6.02    ...            NaN   \n1       4.95       4.70       5.37       6.27    ...            NaN   \n2       4.82       4.47       5.37       5.96    ...            NaN   \n3       4.89       4.33       5.37       5.77    ...            NaN   \n4       4.97       4.42       5.37       5.92    ...            NaN   \n\n   603283.SH  002920.SZ  002921.SZ  300684.SZ  002922.SZ  300735.SZ  \\\n0        NaN        NaN        NaN        NaN        NaN        NaN   \n1        NaN        NaN        NaN        NaN        NaN        NaN   \n2        NaN        NaN        NaN        NaN        NaN        NaN   \n3        NaN        NaN        NaN        NaN        NaN        NaN   \n4        NaN        NaN        NaN        NaN        NaN        NaN   \n\n   603329.SH  603655.SH  603080.SH  \n0        NaN        NaN        NaN  \n1        NaN        NaN        NaN  \n2        NaN        NaN        NaN  \n3        NaN        NaN        NaN  \n4        NaN        NaN        NaN  \n\n[5 rows x 3562 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>000001.SZ</th>\n      <th>000002.SZ</th>\n      <th>000004.SZ</th>\n      <th>000005.SZ</th>\n      <th>000006.SZ</th>\n      <th>000007.SZ</th>\n      <th>000008.SZ</th>\n      <th>000009.SZ</th>\n      <th>000010.SZ</th>\n      <th>000011.SZ</th>\n      <th>...</th>\n      <th>001965.SZ</th>\n      <th>603283.SH</th>\n      <th>002920.SZ</th>\n      <th>002921.SZ</th>\n      <th>300684.SZ</th>\n      <th>002922.SZ</th>\n      <th>300735.SZ</th>\n      <th>603329.SH</th>\n      <th>603655.SH</th>\n      <th>603080.SH</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>16.30</td>\n      <td>17.71</td>\n      <td>4.58</td>\n      <td>2.88</td>\n      <td>14.60</td>\n      <td>2.62</td>\n      <td>4.96</td>\n      <td>4.66</td>\n      <td>5.37</td>\n      <td>6.02</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>17.02</td>\n      <td>19.20</td>\n      <td>4.65</td>\n      <td>3.02</td>\n      <td>15.97</td>\n      <td>2.65</td>\n      <td>4.95</td>\n      <td>4.70</td>\n      <td>5.37</td>\n      <td>6.27</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>17.02</td>\n      <td>17.28</td>\n      <td>4.56</td>\n      <td>3.06</td>\n      <td>14.37</td>\n      <td>2.63</td>\n      <td>4.82</td>\n      <td>4.47</td>\n      <td>5.37</td>\n      <td>5.96</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>16.18</td>\n      <td>16.97</td>\n      <td>4.49</td>\n      <td>2.95</td>\n      <td>13.10</td>\n      <td>2.73</td>\n      <td>4.89</td>\n      <td>4.33</td>\n      <td>5.37</td>\n      <td>5.77</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>16.95</td>\n      <td>17.19</td>\n      <td>4.55</td>\n      <td>2.99</td>\n      <td>13.18</td>\n      <td>2.77</td>\n      <td>4.97</td>\n      <td>4.42</td>\n      <td>5.37</td>\n      <td>5.92</td>\n      <td>...</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n    </tr>\n  </tbody>\n</table>\n<p>5 rows × 3562 columns</p>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 69
    }
   ],
   "source": [
    "# 这个存储和读取都要指定键名\n",
    "# hdf5 跨平台,支持压缩,速度最快,\n",
    "# 优先选择的存储方式,可以迁移到hadoop中去\n",
    "\n",
    "data1=pd.read_hdf(path_or_buf='day_close_test.h5',key='day_close')\n",
    "data1\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "outputs": [
    {
     "data": {
      "text/plain": "                                        article_link  \\\n0  https://www.huffingtonpost.com/entry/versace-b...   \n1  https://www.huffingtonpost.com/entry/roseanne-...   \n2  https://local.theonion.com/mom-starting-to-fea...   \n3  https://politics.theonion.com/boehner-just-wan...   \n4  https://www.huffingtonpost.com/entry/jk-rowlin...   \n\n                                            headline  is_sarcastic  \n0  former versace store clerk sues over secret 'b...             0  \n1  the 'roseanne' revival catches up to our thorn...             0  \n2  mom starting to fear son's web series closest ...             1  \n3  boehner just wants wife to listen, not come up...             1  \n4  j.k. rowling wishes snape happy birthday in th...             0  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>article_link</th>\n      <th>headline</th>\n      <th>is_sarcastic</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>https://www.huffingtonpost.com/entry/versace-b...</td>\n      <td>former versace store clerk sues over secret 'b...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>https://www.huffingtonpost.com/entry/roseanne-...</td>\n      <td>the 'roseanne' revival catches up to our thorn...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>https://local.theonion.com/mom-starting-to-fea...</td>\n      <td>mom starting to fear son's web series closest ...</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>https://politics.theonion.com/boehner-just-wan...</td>\n      <td>boehner just wants wife to listen, not come up...</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>https://www.huffingtonpost.com/entry/jk-rowlin...</td>\n      <td>j.k. rowling wishes snape happy birthday in th...</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 70
    }
   ],
   "source": [
    "data=pd.read_json(path_or_buf='Sarcasm_Headlines_Dataset.json',orient='records',lines=True)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "outputs": [
    {
     "data": {
      "text/plain": "                                        article_link  \\\n0  https://www.huffingtonpost.com/entry/versace-b...   \n1  https://www.huffingtonpost.com/entry/roseanne-...   \n2  https://local.theonion.com/mom-starting-to-fea...   \n3  https://politics.theonion.com/boehner-just-wan...   \n4  https://www.huffingtonpost.com/entry/jk-rowlin...   \n\n                                            headline  is_sarcastic  \n0  former versace store clerk sues over secret 'b...             0  \n1  the 'roseanne' revival catches up to our thorn...             0  \n2  mom starting to fear son's web series closest ...             1  \n3  boehner just wants wife to listen, not come up...             1  \n4  j.k. rowling wishes snape happy birthday in th...             0  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>article_link</th>\n      <th>headline</th>\n      <th>is_sarcastic</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>https://www.huffingtonpost.com/entry/versace-b...</td>\n      <td>former versace store clerk sues over secret 'b...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>https://www.huffingtonpost.com/entry/roseanne-...</td>\n      <td>the 'roseanne' revival catches up to our thorn...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>https://local.theonion.com/mom-starting-to-fea...</td>\n      <td>mom starting to fear son's web series closest ...</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>https://politics.theonion.com/boehner-just-wan...</td>\n      <td>boehner just wants wife to listen, not come up...</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>https://www.huffingtonpost.com/entry/jk-rowlin...</td>\n      <td>j.k. rowling wishes snape happy birthday in th...</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 84
    }
   ],
   "source": [
    "\n",
    "data.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "outputs": [],
   "source": [
    "data[:5].to_json(path_or_buf='Sarcasm_Headlines_Dataset_test.json',orient='records',lines=True)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "outputs": [
    {
     "data": {
      "text/plain": "                                        article_link  \\\n0  https://www.huffingtonpost.com/entry/versace-b...   \n1  https://www.huffingtonpost.com/entry/roseanne-...   \n2  https://local.theonion.com/mom-starting-to-fea...   \n3  https://politics.theonion.com/boehner-just-wan...   \n4  https://www.huffingtonpost.com/entry/jk-rowlin...   \n\n                                            headline  is_sarcastic  \n0  former versace store clerk sues over secret 'b...             0  \n1  the 'roseanne' revival catches up to our thorn...             0  \n2  mom starting to fear son's web series closest ...             1  \n3  boehner just wants wife to listen, not come up...             1  \n4  j.k. rowling wishes snape happy birthday in th...             0  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>article_link</th>\n      <th>headline</th>\n      <th>is_sarcastic</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>https://www.huffingtonpost.com/entry/versace-b...</td>\n      <td>former versace store clerk sues over secret 'b...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>https://www.huffingtonpost.com/entry/roseanne-...</td>\n      <td>the 'roseanne' revival catches up to our thorn...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>https://local.theonion.com/mom-starting-to-fea...</td>\n      <td>mom starting to fear son's web series closest ...</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>https://politics.theonion.com/boehner-just-wan...</td>\n      <td>boehner just wants wife to listen, not come up...</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>https://www.huffingtonpost.com/entry/jk-rowlin...</td>\n      <td>j.k. rowling wishes snape happy birthday in th...</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 75
    }
   ],
   "source": [
    "# 读取采用read_**,写入采用to_**\n",
    "data1=pd.read_json(path_or_buf='Sarcasm_Headlines_Dataset_test.json',orient='records',lines=True)\n",
    "data1"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "outputs": [
    {
     "data": {
      "text/plain": "             low  total_turnover  close  num_trades  limit_up  limit_down  \\\ndate                                                                        \n2021-03-10  4.08    2.546598e+07   4.09      2908.0      4.54        3.72   \n2021-03-11  4.03    3.035027e+07   4.21      3579.0      4.50        3.68   \n2021-03-12  4.16    5.731667e+07   4.42     10361.0      4.63        3.79   \n2021-03-15  4.39    1.105771e+08   4.86      8739.0      4.86        3.98   \n2021-03-16  5.35    6.590195e+07   5.35      2665.0      5.35        4.37   \n2021-03-17  5.89    2.779356e+07   5.89      1360.0      5.89        4.82   \n2021-03-18  6.02    6.896758e+08   6.48     35915.0      6.48        5.30   \n2021-03-19  6.14    9.281842e+08   6.87     83411.0      7.13        5.83   \n2021-03-22  6.54    7.070684e+08   7.56     57080.0      7.56        6.18   \n2021-03-23  7.18    1.009227e+09   8.32     74794.0      8.32        6.80   \n2021-03-24  8.75    4.638337e+08   9.15     29936.0      9.15        7.49   \n2021-03-25  8.24    1.406457e+09   8.78    122203.0     10.07        8.24   \n2021-03-26  7.90    1.084878e+09   8.20     97696.0      9.66        7.90   \n2021-03-29  7.71    1.073137e+09   8.25     96314.0      9.02        7.38   \n2021-03-30  7.43    8.168007e+08   7.51     73385.0      9.08        7.43   \n2021-03-31  7.15    7.424906e+08   7.40     66253.0      8.26        6.76   \n2021-04-01  7.01    5.871877e+08   7.30     50391.0      8.14        6.66   \n2021-04-02  6.97    5.391238e+08   6.98     45938.0      8.03        6.57   \n2021-04-06  6.90    4.933757e+08   7.11     38072.0      7.68        6.28   \n2021-04-07  7.00    8.267101e+08   7.56     70670.0      7.82        6.40   \n\n                 volume   high  open  \ndate                                  \n2021-03-10    6129016.0   4.26  4.20  \n2021-03-11    7253204.0   4.30  4.06  \n2021-03-12   13122895.0   4.49  4.18  \n2021-03-15   23415491.0   4.86  4.41  \n2021-03-16   12318121.0   5.35  5.35  \n2021-03-17    4718770.0   5.89  5.89  \n2021-03-18  108723518.0   6.48  6.30  \n2021-03-19  139087883.0   7.12  6.14  \n2021-03-22  100705316.0   7.56  6.76  \n2021-03-23  127027051.0   8.32  7.86  \n2021-03-24   51111322.0   9.15  9.15  \n2021-03-25  159859689.0  10.00  9.70  \n2021-03-26  132371665.0   8.64  8.30  \n2021-03-29  131232671.0   8.49  8.10  \n2021-03-30  108642707.0   7.96  7.79  \n2021-03-31   99402765.0   7.84  7.27  \n2021-04-01   81607548.0   7.45  7.21  \n2021-04-02   74883092.0   7.52  7.30  \n2021-04-06   69771188.0   7.23  6.95  \n2021-04-07  111218570.0   7.78  7.00  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>low</th>\n      <th>total_turnover</th>\n      <th>close</th>\n      <th>num_trades</th>\n      <th>limit_up</th>\n      <th>limit_down</th>\n      <th>volume</th>\n      <th>high</th>\n      <th>open</th>\n    </tr>\n    <tr>\n      <th>date</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2021-03-10</th>\n      <td>4.08</td>\n      <td>2.546598e+07</td>\n      <td>4.09</td>\n      <td>2908.0</td>\n      <td>4.54</td>\n      <td>3.72</td>\n      <td>6129016.0</td>\n      <td>4.26</td>\n      <td>4.20</td>\n    </tr>\n    <tr>\n      <th>2021-03-11</th>\n      <td>4.03</td>\n      <td>3.035027e+07</td>\n      <td>4.21</td>\n      <td>3579.0</td>\n      <td>4.50</td>\n      <td>3.68</td>\n      <td>7253204.0</td>\n      <td>4.30</td>\n      <td>4.06</td>\n    </tr>\n    <tr>\n      <th>2021-03-12</th>\n      <td>4.16</td>\n      <td>5.731667e+07</td>\n      <td>4.42</td>\n      <td>10361.0</td>\n      <td>4.63</td>\n      <td>3.79</td>\n      <td>13122895.0</td>\n      <td>4.49</td>\n      <td>4.18</td>\n    </tr>\n    <tr>\n      <th>2021-03-15</th>\n      <td>4.39</td>\n      <td>1.105771e+08</td>\n      <td>4.86</td>\n      <td>8739.0</td>\n      <td>4.86</td>\n      <td>3.98</td>\n      <td>23415491.0</td>\n      <td>4.86</td>\n      <td>4.41</td>\n    </tr>\n    <tr>\n      <th>2021-03-16</th>\n      <td>5.35</td>\n      <td>6.590195e+07</td>\n      <td>5.35</td>\n      <td>2665.0</td>\n      <td>5.35</td>\n      <td>4.37</td>\n      <td>12318121.0</td>\n      <td>5.35</td>\n      <td>5.35</td>\n    </tr>\n    <tr>\n      <th>2021-03-17</th>\n      <td>5.89</td>\n      <td>2.779356e+07</td>\n      <td>5.89</td>\n      <td>1360.0</td>\n      <td>5.89</td>\n      <td>4.82</td>\n      <td>4718770.0</td>\n      <td>5.89</td>\n      <td>5.89</td>\n    </tr>\n    <tr>\n      <th>2021-03-18</th>\n      <td>6.02</td>\n      <td>6.896758e+08</td>\n      <td>6.48</td>\n      <td>35915.0</td>\n      <td>6.48</td>\n      <td>5.30</td>\n      <td>108723518.0</td>\n      <td>6.48</td>\n      <td>6.30</td>\n    </tr>\n    <tr>\n      <th>2021-03-19</th>\n      <td>6.14</td>\n      <td>9.281842e+08</td>\n      <td>6.87</td>\n      <td>83411.0</td>\n      <td>7.13</td>\n      <td>5.83</td>\n      <td>139087883.0</td>\n      <td>7.12</td>\n      <td>6.14</td>\n    </tr>\n    <tr>\n      <th>2021-03-22</th>\n      <td>6.54</td>\n      <td>7.070684e+08</td>\n      <td>7.56</td>\n      <td>57080.0</td>\n      <td>7.56</td>\n      <td>6.18</td>\n      <td>100705316.0</td>\n      <td>7.56</td>\n      <td>6.76</td>\n    </tr>\n    <tr>\n      <th>2021-03-23</th>\n      <td>7.18</td>\n      <td>1.009227e+09</td>\n      <td>8.32</td>\n      <td>74794.0</td>\n      <td>8.32</td>\n      <td>6.80</td>\n      <td>127027051.0</td>\n      <td>8.32</td>\n      <td>7.86</td>\n    </tr>\n    <tr>\n      <th>2021-03-24</th>\n      <td>8.75</td>\n      <td>4.638337e+08</td>\n      <td>9.15</td>\n      <td>29936.0</td>\n      <td>9.15</td>\n      <td>7.49</td>\n      <td>51111322.0</td>\n      <td>9.15</td>\n      <td>9.15</td>\n    </tr>\n    <tr>\n      <th>2021-03-25</th>\n      <td>8.24</td>\n      <td>1.406457e+09</td>\n      <td>8.78</td>\n      <td>122203.0</td>\n      <td>10.07</td>\n      <td>8.24</td>\n      <td>159859689.0</td>\n      <td>10.00</td>\n      <td>9.70</td>\n    </tr>\n    <tr>\n      <th>2021-03-26</th>\n      <td>7.90</td>\n      <td>1.084878e+09</td>\n      <td>8.20</td>\n      <td>97696.0</td>\n      <td>9.66</td>\n      <td>7.90</td>\n      <td>132371665.0</td>\n      <td>8.64</td>\n      <td>8.30</td>\n    </tr>\n    <tr>\n      <th>2021-03-29</th>\n      <td>7.71</td>\n      <td>1.073137e+09</td>\n      <td>8.25</td>\n      <td>96314.0</td>\n      <td>9.02</td>\n      <td>7.38</td>\n      <td>131232671.0</td>\n      <td>8.49</td>\n      <td>8.10</td>\n    </tr>\n    <tr>\n      <th>2021-03-30</th>\n      <td>7.43</td>\n      <td>8.168007e+08</td>\n      <td>7.51</td>\n      <td>73385.0</td>\n      <td>9.08</td>\n      <td>7.43</td>\n      <td>108642707.0</td>\n      <td>7.96</td>\n      <td>7.79</td>\n    </tr>\n    <tr>\n      <th>2021-03-31</th>\n      <td>7.15</td>\n      <td>7.424906e+08</td>\n      <td>7.40</td>\n      <td>66253.0</td>\n      <td>8.26</td>\n      <td>6.76</td>\n      <td>99402765.0</td>\n      <td>7.84</td>\n      <td>7.27</td>\n    </tr>\n    <tr>\n      <th>2021-04-01</th>\n      <td>7.01</td>\n      <td>5.871877e+08</td>\n      <td>7.30</td>\n      <td>50391.0</td>\n      <td>8.14</td>\n      <td>6.66</td>\n      <td>81607548.0</td>\n      <td>7.45</td>\n      <td>7.21</td>\n    </tr>\n    <tr>\n      <th>2021-04-02</th>\n      <td>6.97</td>\n      <td>5.391238e+08</td>\n      <td>6.98</td>\n      <td>45938.0</td>\n      <td>8.03</td>\n      <td>6.57</td>\n      <td>74883092.0</td>\n      <td>7.52</td>\n      <td>7.30</td>\n    </tr>\n    <tr>\n      <th>2021-04-06</th>\n      <td>6.90</td>\n      <td>4.933757e+08</td>\n      <td>7.11</td>\n      <td>38072.0</td>\n      <td>7.68</td>\n      <td>6.28</td>\n      <td>69771188.0</td>\n      <td>7.23</td>\n      <td>6.95</td>\n    </tr>\n    <tr>\n      <th>2021-04-07</th>\n      <td>7.00</td>\n      <td>8.267101e+08</td>\n      <td>7.56</td>\n      <td>70670.0</td>\n      <td>7.82</td>\n      <td>6.40</td>\n      <td>111218570.0</td>\n      <td>7.78</td>\n      <td>7.00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 80
    }
   ],
   "source": [
    "stock_price=pd.read_csv(filepath_or_buffer='test1.csv',sep=',',index_col=0)\n",
    "stock_price.drop(labels=['num_trades','total_turnover','volume'],axis=1,)\n",
    "stock_price"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "outputs": [
    {
     "data": {
      "text/plain": "             low  total_turnover  close  num_trades  limit_up  limit_down  \\\ndate                                                                        \n2021-03-10  4.08    2.546598e+07   4.09      2908.0      4.54        3.72   \n2021-03-11  4.03    3.035027e+07   4.21      3579.0      4.50        3.68   \n2021-03-12  4.16    5.731667e+07   4.42     10361.0      4.63        3.79   \n2021-03-15  4.39    1.105771e+08   4.86      8739.0      4.86        3.98   \n2021-03-16  5.35    6.590195e+07   5.35      2665.0      5.35        4.37   \n2021-03-17  5.89    2.779356e+07   5.89      1360.0      5.89        4.82   \n2021-03-18  6.02    6.896758e+08   6.48     35915.0      6.48        5.30   \n2021-03-19  6.14    9.281842e+08   6.87     83411.0      7.13        5.83   \n2021-03-22  6.54    7.070684e+08   7.56     57080.0      7.56        6.18   \n2021-03-23  7.18    1.009227e+09   8.32     74794.0      8.32        6.80   \n2021-03-24  8.75    4.638337e+08   9.15     29936.0      9.15        7.49   \n2021-03-25  8.24    1.406457e+09   8.78    122203.0     10.07        8.24   \n2021-03-26  7.90    1.084878e+09   8.20     97696.0      9.66        7.90   \n2021-03-29  7.71    1.073137e+09   8.25     96314.0      9.02        7.38   \n2021-03-30  7.43    8.168007e+08   7.51     73385.0      9.08        7.43   \n2021-03-31  7.15    7.424906e+08   7.40     66253.0      8.26        6.76   \n2021-04-01  7.01    5.871877e+08   7.30     50391.0      8.14        6.66   \n2021-04-02  6.97    5.391238e+08   6.98     45938.0      8.03        6.57   \n2021-04-06  6.90    4.933757e+08   7.11     38072.0      7.68        6.28   \n2021-04-07  7.00    8.267101e+08   7.56     70670.0      7.82        6.40   \n\n                 volume   high  open  \ndate                                  \n2021-03-10    6129016.0   4.26  4.20  \n2021-03-11    7253204.0   4.30  4.06  \n2021-03-12   13122895.0   4.49  4.18  \n2021-03-15   23415491.0   4.86  4.41  \n2021-03-16   12318121.0   5.35  5.35  \n2021-03-17    4718770.0   5.89  5.89  \n2021-03-18  108723518.0   6.48  6.30  \n2021-03-19  139087883.0   7.12  6.14  \n2021-03-22  100705316.0   7.56  6.76  \n2021-03-23  127027051.0   8.32  7.86  \n2021-03-24   51111322.0   9.15  9.15  \n2021-03-25  159859689.0  10.00  9.70  \n2021-03-26  132371665.0   8.64  8.30  \n2021-03-29  131232671.0   8.49  8.10  \n2021-03-30  108642707.0   7.96  7.79  \n2021-03-31   99402765.0   7.84  7.27  \n2021-04-01   81607548.0   7.45  7.21  \n2021-04-02   74883092.0   7.52  7.30  \n2021-04-06   69771188.0   7.23  6.95  \n2021-04-07  111218570.0   7.78  7.00  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>low</th>\n      <th>total_turnover</th>\n      <th>close</th>\n      <th>num_trades</th>\n      <th>limit_up</th>\n      <th>limit_down</th>\n      <th>volume</th>\n      <th>high</th>\n      <th>open</th>\n    </tr>\n    <tr>\n      <th>date</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2021-03-10</th>\n      <td>4.08</td>\n      <td>2.546598e+07</td>\n      <td>4.09</td>\n      <td>2908.0</td>\n      <td>4.54</td>\n      <td>3.72</td>\n      <td>6129016.0</td>\n      <td>4.26</td>\n      <td>4.20</td>\n    </tr>\n    <tr>\n      <th>2021-03-11</th>\n      <td>4.03</td>\n      <td>3.035027e+07</td>\n      <td>4.21</td>\n      <td>3579.0</td>\n      <td>4.50</td>\n      <td>3.68</td>\n      <td>7253204.0</td>\n      <td>4.30</td>\n      <td>4.06</td>\n    </tr>\n    <tr>\n      <th>2021-03-12</th>\n      <td>4.16</td>\n      <td>5.731667e+07</td>\n      <td>4.42</td>\n      <td>10361.0</td>\n      <td>4.63</td>\n      <td>3.79</td>\n      <td>13122895.0</td>\n      <td>4.49</td>\n      <td>4.18</td>\n    </tr>\n    <tr>\n      <th>2021-03-15</th>\n      <td>4.39</td>\n      <td>1.105771e+08</td>\n      <td>4.86</td>\n      <td>8739.0</td>\n      <td>4.86</td>\n      <td>3.98</td>\n      <td>23415491.0</td>\n      <td>4.86</td>\n      <td>4.41</td>\n    </tr>\n    <tr>\n      <th>2021-03-16</th>\n      <td>5.35</td>\n      <td>6.590195e+07</td>\n      <td>5.35</td>\n      <td>2665.0</td>\n      <td>5.35</td>\n      <td>4.37</td>\n      <td>12318121.0</td>\n      <td>5.35</td>\n      <td>5.35</td>\n    </tr>\n    <tr>\n      <th>2021-03-17</th>\n      <td>5.89</td>\n      <td>2.779356e+07</td>\n      <td>5.89</td>\n      <td>1360.0</td>\n      <td>5.89</td>\n      <td>4.82</td>\n      <td>4718770.0</td>\n      <td>5.89</td>\n      <td>5.89</td>\n    </tr>\n    <tr>\n      <th>2021-03-18</th>\n      <td>6.02</td>\n      <td>6.896758e+08</td>\n      <td>6.48</td>\n      <td>35915.0</td>\n      <td>6.48</td>\n      <td>5.30</td>\n      <td>108723518.0</td>\n      <td>6.48</td>\n      <td>6.30</td>\n    </tr>\n    <tr>\n      <th>2021-03-19</th>\n      <td>6.14</td>\n      <td>9.281842e+08</td>\n      <td>6.87</td>\n      <td>83411.0</td>\n      <td>7.13</td>\n      <td>5.83</td>\n      <td>139087883.0</td>\n      <td>7.12</td>\n      <td>6.14</td>\n    </tr>\n    <tr>\n      <th>2021-03-22</th>\n      <td>6.54</td>\n      <td>7.070684e+08</td>\n      <td>7.56</td>\n      <td>57080.0</td>\n      <td>7.56</td>\n      <td>6.18</td>\n      <td>100705316.0</td>\n      <td>7.56</td>\n      <td>6.76</td>\n    </tr>\n    <tr>\n      <th>2021-03-23</th>\n      <td>7.18</td>\n      <td>1.009227e+09</td>\n      <td>8.32</td>\n      <td>74794.0</td>\n      <td>8.32</td>\n      <td>6.80</td>\n      <td>127027051.0</td>\n      <td>8.32</td>\n      <td>7.86</td>\n    </tr>\n    <tr>\n      <th>2021-03-24</th>\n      <td>8.75</td>\n      <td>4.638337e+08</td>\n      <td>9.15</td>\n      <td>29936.0</td>\n      <td>9.15</td>\n      <td>7.49</td>\n      <td>51111322.0</td>\n      <td>9.15</td>\n      <td>9.15</td>\n    </tr>\n    <tr>\n      <th>2021-03-25</th>\n      <td>8.24</td>\n      <td>1.406457e+09</td>\n      <td>8.78</td>\n      <td>122203.0</td>\n      <td>10.07</td>\n      <td>8.24</td>\n      <td>159859689.0</td>\n      <td>10.00</td>\n      <td>9.70</td>\n    </tr>\n    <tr>\n      <th>2021-03-26</th>\n      <td>7.90</td>\n      <td>1.084878e+09</td>\n      <td>8.20</td>\n      <td>97696.0</td>\n      <td>9.66</td>\n      <td>7.90</td>\n      <td>132371665.0</td>\n      <td>8.64</td>\n      <td>8.30</td>\n    </tr>\n    <tr>\n      <th>2021-03-29</th>\n      <td>7.71</td>\n      <td>1.073137e+09</td>\n      <td>8.25</td>\n      <td>96314.0</td>\n      <td>9.02</td>\n      <td>7.38</td>\n      <td>131232671.0</td>\n      <td>8.49</td>\n      <td>8.10</td>\n    </tr>\n    <tr>\n      <th>2021-03-30</th>\n      <td>7.43</td>\n      <td>8.168007e+08</td>\n      <td>7.51</td>\n      <td>73385.0</td>\n      <td>9.08</td>\n      <td>7.43</td>\n      <td>108642707.0</td>\n      <td>7.96</td>\n      <td>7.79</td>\n    </tr>\n    <tr>\n      <th>2021-03-31</th>\n      <td>7.15</td>\n      <td>7.424906e+08</td>\n      <td>7.40</td>\n      <td>66253.0</td>\n      <td>8.26</td>\n      <td>6.76</td>\n      <td>99402765.0</td>\n      <td>7.84</td>\n      <td>7.27</td>\n    </tr>\n    <tr>\n      <th>2021-04-01</th>\n      <td>7.01</td>\n      <td>5.871877e+08</td>\n      <td>7.30</td>\n      <td>50391.0</td>\n      <td>8.14</td>\n      <td>6.66</td>\n      <td>81607548.0</td>\n      <td>7.45</td>\n      <td>7.21</td>\n    </tr>\n    <tr>\n      <th>2021-04-02</th>\n      <td>6.97</td>\n      <td>5.391238e+08</td>\n      <td>6.98</td>\n      <td>45938.0</td>\n      <td>8.03</td>\n      <td>6.57</td>\n      <td>74883092.0</td>\n      <td>7.52</td>\n      <td>7.30</td>\n    </tr>\n    <tr>\n      <th>2021-04-06</th>\n      <td>6.90</td>\n      <td>4.933757e+08</td>\n      <td>7.11</td>\n      <td>38072.0</td>\n      <td>7.68</td>\n      <td>6.28</td>\n      <td>69771188.0</td>\n      <td>7.23</td>\n      <td>6.95</td>\n    </tr>\n    <tr>\n      <th>2021-04-07</th>\n      <td>7.00</td>\n      <td>8.267101e+08</td>\n      <td>7.56</td>\n      <td>70670.0</td>\n      <td>7.82</td>\n      <td>6.40</td>\n      <td>111218570.0</td>\n      <td>7.78</td>\n      <td>7.00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 83
    }
   ],
   "source": [
    "# 看看是否一字涨停low=limit_up,\n",
    "stock_price\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "outputs": [
    {
     "data": {
      "text/plain": "True"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 82
    }
   ],
   "source": [
    "# 一字跌停,limit_down=high"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%% \n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
